﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using UniversityCourses.Controllers;
using UniversityCourses.Tests.Models;
using UniversityCourses.Models;

namespace UniversityCourses.Tests.Controllers
{
    [TestClass]
    public class ManageControllerTest
    {
        [TestMethod]
        public void Delete_Course_Test()
        {
            InMemoryUniversityCourses inMemoryUniversityCourses = new InMemoryUniversityCourses();
            Course course = new Course();
            course.Id = 1;
            course.Name = "Name1";          
            inMemoryUniversityCourses.CreateCourse(course);

            Assert.AreEqual(1, inMemoryUniversityCourses.GetAllCourses().Count());

            ManageController controller = new ManageController(inMemoryUniversityCourses);
            controller.DeleteCourse(1);

            Assert.AreEqual(0, inMemoryUniversityCourses.GetAllCourses().Count());
        }
    }
}
